﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="RequestChanges.aspx.cs" Inherits="KPIS.GERP.ESS.APP.App_UI.Forms.RequestChanges" %>

<%@ Register src="../UserControls/ChangePersonal.ascx" tagname="chgPersonal" tagprefix="uc1" %>

<asp:Content 
    ID="Content1" 
    runat="server" 
    contentplaceholderid="ContentPlaceHolder1">   
 
<style type="text/css">
 </style>
   <script type="text/javascript"></script>
   <script type="text/javascript" src="../Scripts/DatePicker.js"></script>
   
     <link href="../Styles/CssClass.css" rel="cssclass" type="text/css" />    
       <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">        
            <script type="text/javascript">
                function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                }
                function checkID(id) {
                    if (id.length != 13) return false;
                    for (i = 0, sum = 0; i < 12; i++)
                        sum += parseFloat(id.charAt(i)) * (13 - i); if ((11 - sum % 11) % 10 != parseFloat(id.charAt(12)))
                        return false; return true;
                }

                function checkForm() {
                    if (!checkID(document.form1.txtID.value))
                        alert('รหัสประชาชนไม่ถูกต้อง');
                }

 
            </script>
        
    </telerik:RadCodeBlock>
  
  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="PanelFilter">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PanelFilter" LoadingPanelID="RadAjaxLoadingPanel1" />                    
                    <telerik:AjaxUpdatedControl ControlID="PanelPersonal" LoadingPanelID="RadAjaxLoadingPanel1" />  
                    <telerik:AjaxUpdatedControl ControlID="PanelGrid" LoadingPanelID="RadAjaxLoadingPanel1" />                    
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="PanelGrid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PanelFilter" LoadingPanelID="RadAjaxLoadingPanel1" />                    
                    <telerik:AjaxUpdatedControl ControlID="PanelPersonal" LoadingPanelID="RadAjaxLoadingPanel1" />  
                    <telerik:AjaxUpdatedControl ControlID="PanelGrid" LoadingPanelID="RadAjaxLoadingPanel1" />                    
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="PanelPersonal">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PanelFilter" LoadingPanelID="RadAjaxLoadingPanel1" />                    
                    <telerik:AjaxUpdatedControl ControlID="PanelPersonal" LoadingPanelID="RadAjaxLoadingPanel1" />   
                    <telerik:AjaxUpdatedControl ControlID="PanelGrid" LoadingPanelID="RadAjaxLoadingPanel1" />                                     
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="PanelPersonal" LoadingPanelID="RadAjaxLoadingPanel1" />                                        
                    <telerik:AjaxUpdatedControl ControlID="chgPersonal1" LoadingPanelID="RadAjaxLoadingPanel1" />  
                    <telerik:AjaxUpdatedControl ControlID="PanelGrid" LoadingPanelID="RadAjaxLoadingPanel1" />                                                     
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
        
    </telerik:RadAjaxManager>

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
        Height="100%" Width="75px" Transparency="50">
        <table style="height: 100%; width: 100%" border="0">
            <tr>
                <td width="100%" align="center" valign="middle">
                    <img alt="Loading..." 
                        src="../Images/Buttons/loading.gif" 
                        style="border: 0px;" />
                </td>
            </tr>
        </table>
    </telerik:RadAjaxLoadingPanel>   
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
    <telerik:RadWindow 
        id="ProjectDtls" 
        runat="server"
        showcontentduringload="false"
        VisibleStatusbar="false"
        title=""
        width="800px"
        Height="600px"        
        Modal="true"
        behaviors="Close">
    </telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
    <asp:Panel ID="PanelFilter" runat="server" Width="1000px" Height = "380px" ScrollBars="Auto">
        <div class="moduleDivSlim1000">
        <div class="moduleDivBottom1000">
    <table align="center" width="950px">
        <tr>
            <td class="TextHeader">
                <asp:Label ID="lblHeader" runat="server" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Panel ID="PanelGrid" runat="server" ScrollBars="Auto" Width="920px">
                  <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="RadGrid1" runat="server" 
                        AllowAutomaticDeletes="True" 
                        AllowFilteringByColumn="True" AllowMultiRowEdit="True" 
                        AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="True" 
                        AutoGenerateColumns="False" EnableAJAX="True" 
                        EnableAJAXLoadingTemplate="True" 
                        GridLines="None" 
                        OnItemCommand="RadGrid1_ItemCommand"  
                        Width="900px">
                        <MasterTableView AllowMultiColumnSorting="True" 
                            CellSpacing="-1" 
                            ClientDataKeyNames="chg_req_seq" 
                            CommandItemDisplay="Top" 
                            DataKeyNames="chg_req_seq" 
                            InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                            NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                            <CommandItemTemplate>
                                <table width="100%">
                                    <tr>
                                        <td>
                                            <asp:LinkButton ID="cmdInsertNew" CommandName="NewInsert" runat="server" CausesValidation="False" > 
                                                <img alt="" src="../Images/Buttons/AddRecord.gif" 
                                                style="border: 0px; vertical-align: middle;" /> จัดทำคำร้อง 
                                            </asp:LinkButton>
                                            <asp:LinkButton ID="cmdAddNew" runat="server" CausesValidation="False" 
                                                CommandName="InitInsert" Visible = "false" >
                                                <img style="border:0px;vertical-align:middle;" alt=""                                    
                                                src="../Images/Buttons/AddRecord.gif" />จัดทำใบลา</asp:LinkButton>
                                            &nbsp;&nbsp;
                                        </td>
                                        <td align="right">
                                        </td> 
                                    </tr>
                                </table>
                            </CommandItemTemplate>
                            <RowIndicatorColumn>
                                <HeaderStyle Width="20px" />
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn>
                                <HeaderStyle Width="20px" />
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridEditCommandColumn 
                                    ButtonType="ImageButton" 
                                    EditText="คลิกเพื่อแก้ไขรายการ" 
                                    ItemStyle-Width="15">
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridEditCommandColumn>
                                <telerik:GridButtonColumn 
                                    ButtonType="ImageButton" 
                                    CommandName="Delete" 
                                    ConfirmDialogType="RadWindow" 
                                    ConfirmText="ลบข้อมูลที่เลือก?" 
                                    ItemStyle-Width="15" 
                                    Text="คลิกเพื่อลบรายการ" 
                                    UniqueName="column1">
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridButtonColumn>
                                <telerik:GridBoundColumn 
                                    DataField="chg_req_seq" 
                                    DataType="System.Int32" 
                                    Display="False" 
                                    HeaderText="chg_req_seq" 
                                    ReadOnly="True" 
                                    UniqueName="chg_req_seq" >
                                </telerik:GridBoundColumn>
                                 <telerik:GridTemplateColumn 
                                    AutoPostBackOnFilter="true" 
                                    ShowFilterIcon="false" 
                                    CurrentFilterFunction="Contains" 
                                    DataField="chg_ref_no" 
                                    FilterControlWidth="100%" 
                                    HeaderStyle-HorizontalAlign="Center" 
                                    HeaderStyle-Width = "100px"
                                    HeaderText="เลขที่คำร้อง" >              
                                    <ItemTemplate>   
                                        <asp:LinkButton ID="cmdShowView" runat="server" CommandName = "ShowDetail"
                                            Text='<%# Eval("chg_ref_no") %>'>
                                        </asp:LinkButton>           
                                    </ItemTemplate>               
                                </telerik:GridTemplateColumn>    
                                <telerik:GridBoundColumn 
                                    AutoPostBackOnFilter="true" 
                                    DataField="chg_date" 
                                    FilterControlWidth="100%" 
                                    HeaderText="วันที่ยื่นคำร้อง" 
                                    ShowFilterIcon="false" 
                                    DataFormatString = "{0:dd/MM/yyyy}"
                                    UniqueName="chg_date">
                                    <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn 
                                    AutoPostBackOnFilter="true" 
                                    CurrentFilterFunction="Contains" 
                                    DataField="chg_type_name" 
                                    FilterControlWidth="100%" 
                                    HeaderText="ประเภทคำร้อง" 
                                    ShowFilterIcon="false"
                                    UniqueName="chg_type_name">
                                    <HeaderStyle HorizontalAlign="Center" Width="100px" Wrap="False" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn 
                                    AutoPostBackOnFilter="true" 
                                    DataField="chg_status_name" 
                                    FilterControlWidth="100%" 
                                    HeaderText="สถานะคำร้อง" 
                                    ShowFilterIcon="false" 
                                    UniqueName="chg_status_name">
                                    <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridBoundColumn>                                
                                <telerik:GridBoundColumn 
                                    AutoPostBackOnFilter="true" 
                                    DataField="remarks" 
                                    FilterControlWidth="100%" 
                                    HeaderText="หมายเหตุ" 
                                    ShowFilterIcon="false" 
                                    UniqueName="remarks">
                                    <HeaderStyle HorizontalAlign="Center" Width="200px" />
                                </telerik:GridBoundColumn>                                
                            </Columns>
                            <EditFormSettings EditFormType="WebUserControl" 
                                UserControlName="../UserControls/RequestAbsences.ascx">
                                <EditColumn UniqueName="EditCommandColumn1">
                                </EditColumn>
                            </EditFormSettings>
                            <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                        </MasterTableView>
                        <ClientSettings AllowColumnHide="True" 
                            AllowColumnsReorder="True" 
                            EnableRowHoverStyle="True" 
                            ReorderColumnsOnClient="True">
                            <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                        </ClientSettings>
                    </telerik:RadGrid>              
                </asp:Panel>
            </td>
        </tr>
    </table>
    </div> 
    </div>    
    </asp:Panel> 
    <asp:Panel ID="PanelMain" runat="server">
    <table align="center" width="950px">
    <tr>
    <td>   
         <div class="moduleTaskListMenu1000">
        <div class="moduleTaskListMenuMiddle1000">
        <div class="moduleTaskListMenuBottom1000">
            <ul class="formList" style="width: 700px">
                <li>
                    <table width="680px">
                        <tr>
                            <td class="TextHeader">
                                แบบฟอร์มขอแก้ไขข้อมูลส่วนบุคคล<asp:Label ID="lblStatus" runat="server" Visible="False" />
                                
                                <asp:Label ID="lblEmpSeq" runat="server" Visible="False" />
                                
                                <asp:Label ID="lblSendSeq" runat="server" Visible="false" />
                                <asp:Label ID="lblReplySeq" runat="server" Visible="false" />
                            </td>
                        </tr>
                    </table>
                </li>
                <li class="dotListItem">
                    <table width = "700px">
                        <tr>
                            <td align="right" class="style3" >
                                เลขที่คำร้อง :
                            </td>
                            <td class="style1">
                                <asp:Label ID="lblRefNo" runat="server" ForeColor="#003399" />
                            </td>
                            <td align="right">
                                วันที่ยื่นคำร้อง :
                                <asp:Label ID="lblCreatedDate" runat="server" ForeColor="#003399" />
                            </td>
                        </tr>
                    </table>
                </li>
                <li class="dotListItem">
                    <table>
                        <tr>
                            <td align="right" width="100px">
                                คำนำหน้า :
                            </td>
                            <td colspan="3" class="style6">
                            &nbsp;ชื่อ :
                                    <telerik:RadTextBox 
                                        ID="txtFirstName" 
                                        Runat="server" 
                                         
                                        TabIndex="1"                 
                                        Width="150px" >
                                    </telerik:RadTextBox> 
                            &nbsp; นามสกุล : 
                            &nbsp;<telerik:RadTextBox 
                                        ID="txtLastName" 
                                        Runat="server" 
                                         
                                        TabIndex="1"                 
                                        Width="150px" >
                                    </telerik:RadTextBox> 
                            </td>
                        </tr>
                    </table>
                </li>
                        
                <li class="dotListItem">
                    <table>
                        <tr>
                            <td align="right" width="100px">
                                ข้อมูลที่ขอแก้ไข :
                            </td>
                            <td width="250px">
                                <telerik:RadComboBox ID="cmbChangeType" Runat="server" 
                                   AllowCustomText="true" 
                                   CausesValidation="false" 
                                   EmptyMessage=".. พิมพ์ที่นี่เพื่อช่วยค้นหา .." 
                                   EnableLoadOnDemand="true" 
                                   EnableTextSelection="true" 
                                   EnableVirtualScrolling="true" Filter="Contains" 
                                   Height="230px" MarkFirstMatch="false" 
                                   OnClientTextChange="onTextChange" 
                                   ShowDropDownOnTextboxClick="true" 
                                   ShowMoreResultsBox="true" Width="200px" 
                                   HighlightTemplatedItems = "true"
                                   onitemsrequested="cmbRaceNational_ItemsRequested">
                               </telerik:RadComboBox>
                            </td>
                            <td align="right" width="100px">
                                สัญชาติ :
                            </td>
                            <td >
                                <telerik:RadComboBox ID="cmbNational" Runat="server" 
                                   AllowCustomText="true" 
                                   CausesValidation="false" 
                                   EmptyMessage=".. พิมพ์ที่นี่เพื่อช่วยค้นหา .." 
                                   EnableLoadOnDemand="true" 
                                   EnableTextSelection="true" 
                                   EnableVirtualScrolling="true" Filter="Contains" 
                                   Height="230px" MarkFirstMatch="false" 
                                   OnClientTextChange="onTextChange" 
                                   ShowDropDownOnTextboxClick="true" 
                                   ShowMoreResultsBox="true" Width="200px" 
                                   HighlightTemplatedItems = "true"
                                   onitemsrequested="cmbNational_ItemsRequested">
                               </telerik:RadComboBox>
                            </td>
                        </tr>
                    </table>
                </li>
                
                     
               <li class="dotListItem">
                    <table>  
                        <tr>
                            <td align="right" class="style4">
                                <asp:Label ID="lblApprovedReasonTitle" runat="server" Visible="False" >หมายเหตุเพิ่มเติม :</asp:Label>
                            </td>
                            <td colspan="2" class="style2">
                                <telerik:RadTextBox Visible = "false" 
                                    ID="txtRemarks" 
                                    MaxLength = "255"
                                    Runat="server" 
                                     
                                    TabIndex="1"  
                                    TextMode ="MultiLine"
                                    Rows = "3"               
                                    Width="500px" >
                                </telerik:RadTextBox>
                               
                            </td>
                        </tr>
                    </table>
                </li>
                <li >
                    <table>
                        <tr>
                            <td align="right" width="100px">
                               
                            </td>
                            <td colspan="3">
                                <asp:Button ID="btnUpdate" runat="server" 
                                    CommandName="Update" onclick="btnUpdate_Click" text="บันทึก" />
                                <asp:Button ID="btnAddnew" runat="server" 
                                    CommandName="Update" onclick="btnAddnew_Click" text="บันทึก" />
                                &nbsp;<asp:Button ID="btnCancel" runat="server" 
                                    causesvalidation="False" commandname="Cancel" onclick="btnCancel_Click" 
                                    text="ยกเลิก" />
                                <asp:Button ID="btnBackHome" runat="server" 
                                    causesvalidation="False" commandname="Cancel" onclick="btnBackHome_Click" 
                                    text="กลับหน้าหลัก" />
                            </td>
                        </tr>
                    </table>
                </li>
                
               
            </ul>
            <br />
        </div>
        </div>
        </div>
    </td>
    </tr>
    </table>
    </asp:Panel>
    <asp:Panel ID="PanelPersonal" runat="server">
    <table align="center" width="950px">
    <tr>
    <td>   
        <uc1:chgPersonal ID="chgPersonal1" runat="server" />    
    </td>
    </tr>
    </table>
    </asp:Panel>
</asp:Content>
<asp:Content ID="Content2" runat="server" contentplaceholderid="head">

</asp:Content>

